//
//  MarketCenterColView.m
//  GeYou
//
//  Created by MRzhang on 2018/3/15.
//  Copyright © 2018年 geyou. All rights reserved.
//

#import "MarketCenterColView.h"
#import "Head.h"
@interface MarketCenterColView ()

@property(nonatomic,strong)UILabel* titleLab;
@property(nonatomic,strong)UIImageView* titleIV;
@end
@implementation MarketCenterColView
-(instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self)
    {
        _titleLab=[[UILabel alloc] init];
        _titleLab.font=[UIFont systemFontOfSize:15];
        _titleLab.textAlignment=NSTextAlignmentCenter;
        _titleLab.textColor=Main_Color_Black;
        [self addSubview:_titleLab];
        
        _titleIV=[[UIImageView alloc] init];
        [self addSubview:_titleIV];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    if (_issingle)
    {
        _titleLab.frame=CGRectMake(0, 0, self.bounds.size.width/2, 20);
        _titleLab.text=_sourceDic[@"title"];
        
        _titleIV.image=[UIImage imageNamed:_sourceDic[@"img"]];
        _titleIV.frame=CGRectMake(0,0, _titleIV.image.size.width, _titleIV.image.size.height);
        _titleIV.center=CGPointMake(self.center.x, self.center.y-20);
        _titleLab.center=CGPointMake(self.center.x, self.center.y+50);
    }else
    {
        _titleLab.frame=CGRectMake(0, 0, self.bounds.size.width/2, self.bounds.size.height);
        _titleLab.text=_sourceDic[@"title"];
        
        _titleIV.image=[UIImage imageNamed:_sourceDic[@"img"]];
        _titleIV.frame=CGRectMake(self.bounds.size.width/2+(self.bounds.size.width/2-_titleIV.image.size.width)/2, (self.bounds.size.height-_titleIV.image.size.height)/2, _titleIV.image.size.width, _titleIV.image.size.height);
    }
}


@end
